package de.tabuma.soap.entity;

import javax.jdo.annotations.*;
import de.tabuma.soap.entity.wsdl.*;
import java.io.*;

/**
 *
 * @author $Author: alefen $
 * @version $Revision: 1.1 $
 * @since $Date: 2009/12/30 02:53:55 $
 */
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Project implements Serializable, Cloneable {

    public Project(String user, String name, String description, String url, String method, boolean extendedMode, Long wsdlFile) {
        this.user = user;
        this.name = name;
        this.description = description;
        this.droped = false;
        this.wsdlFile = wsdlFile;
        this.url = url;
        this.method = method;
        this.extendedMode = extendedMode;
    }

    public Project(String user, String name, String description) {
        this.user = user;
        this.name = name;
        this.description = description;
        this.droped = false;
    }

    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Long id;

    public Long getId() {
        return id;
    }

    @Persistent
    private String name;
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }

    @Persistent
    private String description;
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }

    @Persistent
    private String method;

    public String getMethod() {
        return method;
    }
    public void setMethod(String method) {
        this.method = method;
    }

    @Persistent
    private String user;
    public String getUser() {
        return user;
    }
    public void setUser(String user) {
        this.user = user;
    }

    @Persistent
    private Boolean droped;
    public Boolean getDroped() {
        return droped;
    }
    public void setDroped(Boolean droped) {
        this.droped = droped;
    }

    @Persistent
    private Boolean extendedMode;
    public Boolean getExtendedMode() {
        return extendedMode;
    }
    public void setExtendedMode(Boolean extendedMode) {
        this.extendedMode = extendedMode;
    }

    @Persistent
    private Long wsdlFile;
    public Long getWsdlFile() {
        return wsdlFile;
    }
    public void setWsdlFile(Long wsdlFile) {
        this.wsdlFile = wsdlFile;
    }

    @Persistent
    private String url;
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }

    @Override
    public Object clone() throws CloneNotSupportedException {
        Project project = new Project(user, name, description, url, method, extendedMode, wsdlFile);
        project.setDroped(this.droped);
        return project;
    }
}
